﻿Public Class frmInsertarPrograma

    Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnRegistrar.Click
        Dim Validor As New ValidadorDeFormularios(Me, ErrorProvider1)
        Dim FormularioValido As Boolean = Validor.ValidarFormulario()

        If FormularioValido = False Then
            Return
        End If

        Dim nombre As String = txtString.Text
        Dim fechaInicio As Date = Convert.ToDateTime(dptFechaInicio.Text)
        Dim fechaFinal As String = Convert.ToDateTime(dptFechaFinal.Text)
        Dim alcance As String = rtbString2.Text

        If objGestor.insertarPrograma(nombre, fechaInicio, fechaFinal, alcance) Then
            MsgBox("El Programa se ingreso correctamente.")
            txtString.Text = ""
            rtbString2.Text = ""
            txtString.Focus()
        Else
            MsgBox("El Programa No se ingreso correctamente.")

        End If

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

    Private Sub frmInsertarPrograma_Activated(sender As Object, e As EventArgs) Handles Me.Activated
        ModuloGeneral.Centrar(Me.Panel1)
    End Sub

    Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint

    End Sub
End Class